﻿// -----------------------------------------------------------------------
// <copyright file="ChangeSet.cs" company="FastNET Services">
//     Copyright (c) 2008-2009. All Rights Reserved.
// </copyright>
// <license>
//    GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
// -----------------------------------------------------------------------
#region Usings
using System;
using System.ComponentModel;
using System.Xml.Schema;
using System.Xml.Serialization;
#endregion

namespace GateShift.Tools.DatabaseMigration.Configuration
{
    /// <summary>
    /// Database ChangeSet Configuration Class
    /// </summary>
    [XmlType(TypeName = "changeSet"), Serializable]
    [EditorBrowsable(EditorBrowsableState.Advanced)]
    public class ChangeSet
    {
        /// <summary>
        /// Initializes a new instance of the ChangeSet class
        /// </summary>
        public ChangeSet()
        {
            Number = string.Empty;
            Database = string.Empty;
            Description = string.Empty;
        }

        /// <summary>
        /// Gets or sets the ChangeSet number
        /// </summary>
        [XmlAttribute(AttributeName = "number", DataType = "integer")]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public string Number { get; set; }

        /// <summary>
        /// Gets or sets the type of change for the ChangeSet
        /// </summary>
        [XmlAttribute(AttributeName = "type")]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public ChangeSetType Type { get; set; }

        /// <summary>
        /// Gets or sets the part for a multipart ChangeSet
        /// </summary>
        [XmlAttribute(AttributeName = "part", DataType = "string")]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public string Part { get; set; }

        /// <summary>
        /// Gets or sets the database alias the ChangeSet applies to
        /// </summary>
        [XmlAttribute(AttributeName = "database", DataType = "string")]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public string Database { get; set; }

        /// <summary>
        /// Gets or sets a description for the ChangeSet
        /// </summary>
        [XmlElement(ElementName = "description", IsNullable = false, Form = XmlSchemaForm.Qualified, DataType = "string")]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public string Description { get; set; }
    }
}
